package com.yimi.policyservice.repository;

import com.yimi.policyservice.entity.base.system.SysRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SysRoleRepository extends JpaRepository<SysRole,String> {
    @Query(value = "select id from t_sys_role where  permissions=?1 limit 1" , nativeQuery = true)
    String  findIdByRoot(String root);
    @Query(value = "select * from t_sys_role order by create_date desc",nativeQuery = true)
    List<SysRole> findAllOrderByCreateDateDesc();
}
